import { createRouter, createWebHistory } from 'vue-router'
import Login from '@/views/Login.vue'
import ForgotPassword from '@/views/ForgotPassword.vue'
import AttractionDetail from '@/components/AttractionDetail.vue'
import AMap from '@/components/AMap.vue'
import UserProfile from '@/views/UserProfile.vue'
import WeatherDetail from '@/components/WeatherDetail.vue'
import Recommendations from '@/components/Recommendations.vue'

const routes = [
  { 
    path: '/', 
    redirect: '/login' // 默认跳转
  },
  { 
    path: '/login',
    name: 'Login',
    component: Login 
  },
  { 
    path: '/forgot-password',
    name: 'ForgotPassword',
    component: ForgotPassword 
  },
  {
    path:'/components/AMap',
    name:'AMap',
    component: AMap 
  },
  {
    path: '/attraction/:id',
    name: 'AttractionDetail',
    component: AttractionDetail
  },
  {
    path: '/profile',
    name: 'UserProfile',
    component: UserProfile
  },
  {
  path: '/weather',
  name: 'WeatherDetail',
  component: WeatherDetail
},
{
    path: '/recommendations',
    name: 'Recommendations',
    component: Recommendations
  }
]

const router = createRouter({
  history: createWebHistory(),
  routes
})


export default router